<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page import="com.edu.ujn.myh.domain.*"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title></title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<link rel="stylesheet" type="text/css" href="css/styles.css">
	<link type="text/css" href="css/message.css" rel="stylesheet">
	<script type="text/javascript" src="js/message.js"></script>
	<script type="text/javascript" src="js/professior.js"></script>
	<script type="text/javascript" src="js/jquery.js"></script>
  </head>
  <body>
  <%
  List list = (List)request.getAttribute("articleList");
  Map map = new HashMap();
  String taskId = (String)request.getAttribute("taskId");
   %>
  	<div>
  	<form action="postArticleAssortAction.action" method="post">
	<fieldset>
	<legend>1、请选择参加审批的稿件</legend>
  		<table style="width:600px;margin-top:15px;">
  			<tr>
  				<th>中文名称</th>
  				<th>英文名称</th>
  				<th>用户姓名</th>
  				<th>学院</th>
  				<th>分类</th>
  				<th>审批状态</th> 	
  				<th>分配状态</th>
  				<th>选择</th>
  			</tr>
  			
  			<% if(list==null){ %>
  				没有需要评审的稿件
  			<%}else { 
  			for(int i=0;i<list.size();i++){
  			ArticleInfo articleInfo = (ArticleInfo)list.get(i);
			String cateName = articleInfo.getCategoryInfo().getName();
				if(!map.containsKey(cateName)){
					map.put(cateName,1);
				}else{
					map.put(cateName,(Integer)map.get(cateName)+1);
				}
  			%>
  			<tr onmouseover="this.className='mouseOver'" onmouseout="this.className='mouseOut'">
  				<td><%=articleInfo.getChinaName() %></td>
  				<td><%=articleInfo.getEnglishName() %></td>
  				<td><%=articleInfo.getUserInfo().getUserName() %></td>
  				<td><%=articleInfo.getCollege() %></td>
  				<td><%=cateName %></td>
  				<td><%=articleInfo.getSpState()==0 ? "未审批":"审批"%></td>
  				<td><%=articleInfo.getFpState()==0 ? "未分配":"分配"%></td>
  				<td><input type="checkbox" name="articleId" checked="checked" value="<%=cateName %>;<%=articleInfo.getAId()%>"></td>
  			</tr>
			<%}} 
			%>
  		</table>
  		</fieldset>
  
  		<fieldset>
  			<legend>2、为选择的类别添加专家</legend>
  			<table>
  				<tr>
  					<th>学科领域</th>
  					<th>稿件数量</th>
  					<th>状态</th>
  					<th>操作</th>
  					
  				</tr>
  			
  			<% if(map.size()==0){ %>
  			  <tr> <td colspan="3">没有需要审批的稿件</td></tr> 
  			<%}else{ %>
  			
  			<% Set set1 = map.keySet();
			for(Iterator iter = set1.iterator();iter.hasNext();){
			String name = (String)iter.next();%>
  		
  			<tr>
			<td><%=name %></td>
			<td><%=map.get(name)%></td>
			<td><span id="<%=name %>">未分配</span></td>
  			<td><a href="javascript:void(0)" onclick="showNewWindow('<%=name%>')">添加专家</a></td>
  			
  		</tr>
  	<%} }%>
  		</table>
  		
  		</fieldset>
  		
  		<fieldset>
  			<legend>3、启动评审流程</legend>
  		<!-- 	<table>
  				 <tr>
  				 	 <th>任务ID</th>
  				 	 <th>任务名称</th>
  				 	 <th>执行ID</th>
  				 	 <th>执行者</th>
  				 	 <th>选择</th>
  				 </tr>
  				 <% List taskList = (List)request.getAttribute("taskList"); 
  				 	if(taskList==null||taskList.size()==0){
  				 %>
  				 <tr>
  				 	<td colspan="4">您当前没有任务</td>
  				 </tr>
  				 <%} else {
  				 	for(int n=0;n<taskList.size();n++){
  				 		//String[] task = (String[])taskList.get(n);
  				 		TaskInfo taskInfo = (TaskInfo)taskList.get(n);
  				 %>
  				 	<tr>
  				 		<td><%=taskInfo.getTaskId() %></td>
  				 		<td><%=taskInfo.getTaskName() %></td>
  				 		<td><%=taskInfo.getExecutionId() %></td>
  				 		<td><%=taskInfo.getUserName() %></td>
  				 		<td><input type="radio" name="taskId" value="<%=taskInfo.getTaskId()%>" <% if(n==0){ %> checked="checked" <%} %>></td>
  				 	</tr>
  				 <%}} %>
  			</table>
  			 -->
  			<input type="hidden" name="taskId" id="taskId" value="<%=taskId %>">
  			<input type="hidden" name="processId" id="processId" value="${processId}">
  			<input type="hidden" name="professior" id="professior" value=""/>
  			<input type="submit" value="提交" style="height:20px;margin-top:10px;margin-left:50px">
  			<input type="reset" value="重置" style="height:20px;margin-left:20px">
  		</fieldset>
  		
  	</form>
  	</div>
  </body>
</html>
